<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/17/017
 * Time: 11:20
 */

namespace app\index\interfaceIn;


use app\Lib\Exception\BlException;
use app\Lib\InterfaceIn\Api\Api;
use app\Lib\Ioc\Tag\HouseTypeTag;

class addHouseTypeTag extends Common implements Api
{
    /**
     * @return mixed
     * @throws BlException
     */
    public function handle()
    {
        $this->check();
        $model = (new HouseTypeTag())->AddTag($this->param->postData);
        return $this->returnCreate($model);
    }

    /**
     *
     * @return bool
     * @throws BlException
     */
    public function check()
    {
        $post  = $this->param->postData;
        if(empty($post['name']) || !isset($post['name'])){
            throw new BlException('装修风格名称不能为空');
        }
        if(empty($post['opUid']) || !isset($post['opUid'])){
            throw new BlException('操作人不能为空');
        }
        return true;
    }

}